home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 3 / Amiga Tools 3.iso / grafik / raytracing / rayshade-4.0.6.3 / rayfiles / rsdefs / examples / clean.ray < prev    next >
Text File  |  1994-08-09  |  6KB  |  233 lines

  1. /************************************************************************
  2.  *
  3.  *      Clean.ray
  4.  *
  5.  *      This is an example file for the rsdefs package originally
  6.  *    created by Stuart Warmink and modified to use the rsdefs
  7.  *    package.
  8.  *
  9.  *      Please do not edit this file, or any of the other files in
  10.  *      this package!  Make additions to these in your own separate
  11.  *      file.  If you think you have something that should be added
  12.  *      permanently, please send it to Larry Coffin and/or David
  13.  *      DeBry (email addresses listed below).  If we include it in
  14.  *      the next release, we'll put your name in the contributor's
  15.  *      list.
  16.  *
  17.  *      Contributors (in alphabetical order):
  18.  *          Larry Coffin <lcoffin@clciris.chem.umr.edu>
  19.  *          David DeBry <ddebry@dsd.es.com>
  20.  *        Stuart Warmink <sw@groucho.att.com>
  21.  *
  22.  ** Good clean fun
  23.  **
  24.  ** (c) Stuart Warmink, January 1993
  25.  ** sw@groucho.att.com
  26.  ** Feel free to use and/or distribute for non-commercial purposes as long
  27.  ** as this header remains with the file.
  28.  **
  29.  ** "glass" object "borrowed" from the Example directory, generated by C. Kolb
  30.  **
  31.  ** Scene has been optimised for a 4 x 3 ratio image size.  Expect this to
  32.  ** take *lots* of CPU time despite use of "grid"s because of the many
  33.  ** objects (1033!) and samples = 3 or 4 required for the extended and area
  34.  ** light sources.
  35.  **
  36.  */
  37.  
  38. #include    "defs.rh"    
  39.  
  40. /***************************************************************************
  41.  *
  42.  *    Surfaces
  43.  */
  44.  
  45. RSSporcelain_pink(surface porcelain)
  46.  
  47. surface glass
  48.         diffuse .08 .08 .08
  49.         specular .2 .2 .2
  50.         reflect 0.4
  51.         transp 1
  52.         body .9 .9 .9
  53.         index 1.3
  54.         specpow 80
  55.  
  56. surface Tile_gray
  57.     ambient 0.25 0.25 0.25
  58.         diffuse 0.35 0.35 0.35
  59.         reflect 0.10
  60.         specular 1 1 1
  61.         specpow 40
  62.  
  63. surface Grout_white
  64.     ambient 0.5 0.5 0.5
  65.         diffuse 0.5 0.5 0.5
  66.  
  67. /***********************************************************************
  68.  *
  69.  *    Wall Tile constants
  70.  */
  71.  
  72. #define        LEN    4.7     /* cm, was 5.0 */
  73. #define        RAD    0.6    /* cm, was 0.3 */
  74. #define        SEP    (2*((LEN)+(RAD))+0.2)
  75. #define        GD    0.03    /* cm */
  76.  
  77.  
  78. /***********************************************************************
  79.  *
  80.  *    A tile
  81.  */
  82.  
  83. name    Cyl
  84.   list
  85.     disc    (RAD)    (LEN) 0 0         1 0 0
  86.     cylinder    (RAD)    (LEN) 0 0        (-LEN) 0 0
  87.     disc    (RAD)    (-LEN) 0 0    -1 0 0
  88.   end
  89.  
  90. name    Tile
  91.   union
  92.     box    (LEN) (LEN) 0    (-LEN) (-LEN) (RAD)
  93.     union
  94.       list
  95.         sphere    (RAD) (LEN) (LEN) 0
  96.         sphere    (RAD) (LEN) (-LEN) 0
  97.         sphere    (RAD) (-LEN) (LEN) 0
  98.         sphere    (RAD) (-LEN) (-LEN) 0
  99.       end
  100.       list
  101.         object Cyl            translate    0 (LEN) 0
  102.         object Cyl            translate    0 (-LEN) 0
  103.         object Cyl    rotate 0 0 1 90 translate    (LEN) 0 0
  104.         object Cyl    rotate 0 0 1 90 translate    (-LEN) 0 0
  105.       end
  106.     end
  107.   end
  108.   scale    1 1 0.33
  109.  
  110.  
  111. /***********************************************************************
  112.  *
  113.  *    Soap and soap dish
  114.  */
  115.  
  116. RSPsoap_and_dish(,RSSsoap_light(),porcelain)
  117.     translate    (-1*((SEP)/2)) 5 (-1*((SEP)/2))
  118.  
  119. /***********************************************************************
  120.  *
  121.  *    Glass holder
  122.  */
  123.  
  124. RSPglass_holder(,porcelain)
  125.     translate    (-5*((SEP)/2)) 5 (-1*((SEP)/2))
  126.  
  127. /***********************************************************************
  128.  *
  129.  *    Glass
  130.  */
  131.  
  132. RSPglass(,glass)
  133.     scale    3.4 3.4 5.5
  134.     translate    ((-5*((SEP)/2)-0.05)) 4.90 ((-1*((SEP)/2)-1))
  135.  
  136. /***********************************************************************
  137.  *
  138.  *    Toothbrushes!
  139.  */
  140.  
  141. RSPtoothbrush(,RSSplastic_yellow())
  142.     rotate    0 1 0    -92
  143.     rotate    0 0 1    -155
  144.     translate    ((-5*((SEP)/2)+5.5)) (0.5+4.5+2.8) ((-1*((SEP)/2)+0.8))
  145.  
  146. RSPtoothbrush(,RSSplastic())
  147.     rotate    0 1 0    -92
  148.     rotate    0 0 1    -70
  149.     translate    ((-5*((SEP)/2)-5.5)) (0.5+4.5+2.8) ((-1*((SEP)/2)+0.8))
  150.  
  151. /***********************************************************************
  152.  *
  153.  *    Wall of tiles
  154.  */
  155.  
  156. name    Tiled_wall
  157. grid    10 1 6
  158. object  Tile_gray Tile rotate 1 0 0 -90 translate ( 1*(SEP)+0.03) 0 0
  159. object  Tile_gray Tile rotate 1 0 0 -90 translate          0 0 0.03
  160. object  Tile_gray Tile rotate 1 0 0 -90 translate (-1*(SEP)) 0 0
  161. object  Tile_gray Tile rotate 1 0 0 -90 translate (-2*(SEP)-0.02) 0 0
  162. object  Tile_gray Tile rotate 1 0 0 -90 translate (-3*(SEP)-0.035) 0 0.045
  163.   
  164. object  Tile_gray Tile rotate 1 0 0 -90 translate ( 1*(SEP)) 0 (-1*(SEP))
  165. object  porcelain Tile rotate 1 0 0 -90 translate          -0.04 0 (-1*(SEP))
  166. object  Tile_gray Tile rotate 1 0 0 -90 translate (-1*(SEP)) 0 (-1*(SEP)-0.04)
  167. object  porcelain Tile rotate 1 0 0 -90 translate (-2*(SEP)) 0 (-1*(SEP))
  168. object  Tile_gray Tile rotate 1 0 0 -90 translate (-3*(SEP)+0.015) 0 (-1*(SEP))
  169.   
  170. object  Tile_gray Tile rotate 1 0 0 -90 translate ( 1*(SEP)) 0 (-2*(SEP)+0.04)
  171. object  Tile_gray Tile rotate 1 0 0 -90 translate          0 0 (-2*(SEP))
  172. object  Tile_gray Tile rotate 1 0 0 -90 translate (-1*(SEP)+0.02) 0 (-2*(SEP))
  173. object  Tile_gray Tile rotate 1 0 0 -90 translate (-2*(SEP)) 0 (-2*(SEP)-0.01)
  174. object  Tile_gray Tile rotate 1 0 0 -90 translate (-3*(SEP)-0.01) 0 (-2*(SEP))
  175. end
  176.  
  177. object  Tiled_wall
  178.     translate    (-1*((SEP)/2)) 0 ((SEP)/2)
  179.          texture bump 0.05    scale 7 7 7
  180.          texture bump 0.02    scale 2 3 4
  181.  
  182. plane   Grout_white    0 (GD) 0    0 1 0
  183.         texture bump    0.7    scale 0.01 0.01 0.01
  184.         texture bump     0.3     scale 2  2  2
  185.  
  186.  
  187. background    0.8 0.8 0.8    /* easy way out of simulating white walls... */
  188.  
  189.  
  190.  
  191. /***********************************************************************
  192.  *
  193.  * light over the sink - two spotlights
  194.  */
  195.  
  196. light 0.4    extended    4
  197.         (-3*((SEP)/2)+12) 10  (12*((SEP)/2))
  198. light 0.4    extended    4
  199.         (-3*((SEP)/2)-12) 10  (12*((SEP)/2))
  200.  
  201. /***********************************************************************
  202.  *
  203.  * fake window lighting, more realistic
  204.  */
  205.  
  206. light    0.8    area
  207.         -20 190 0    -80 190 0    2
  208.                 -20 190 100    3
  209.         
  210. /***********************************************************************
  211.  *
  212.  * simulates inter-diffuse reflections
  213.  */
  214.  
  215. light 1.0    ambient
  216.  
  217. /***********************************************************************
  218.  *
  219.  * normal view
  220.  */
  221.  
  222. eyep    -30 145 35
  223. lookp    (-3.1*((SEP)/2)) 7 ((-2.9/5)*((SEP)/2))
  224. fov    15
  225.  
  226. /***********************************************************************
  227.  *
  228.  * default settings - but keep 4x3 ratio and sample at least 3
  229.  */
  230.  
  231. screen 640 480
  232. sample 3
  233.